from django.conf.urls.defaults import *
from lingcod.common.utils import get_mpa_class
from lingcod.common.utils import get_mpa_form

urlpatterns = patterns('lingcod.mpa.views',
    url(r'^(?P<pk>\d+)/copy/$', 'copy', name="mpa-copy"),
    url(r'^clip/$', 'clip', name='mpa-clip'),
)

urlpatterns += patterns('zones.views',
    url(r'^(?P<pk>\d+)/impacts/$', 'zone_impacts', name='zone-impacts'),
    url(r'^(?P<pk>\d+)/threats/$', 'zone_threats', name='zone-threats'),
)
MpaForm = get_mpa_form()

urlpatterns += patterns('lingcod.rest.views',
    url(r'^form/$', 'form_resources', {'form_class': MpaForm, 'create_title': 'Create a New Zone'}, name='mpa_create_form'),
    url(r'^(?P<pk>\d+)/$', 'resource', {'form_class': MpaForm, 'template': 'mpa/show.html'}, name='mpa_resource'),
    url(r'^(?P<pk>\d+)/form/$', 'form_resources', {'form_class': MpaForm}, name='mpa_update_form'),
)
